<!DOCTYPE html> 
<html> 
<head> 
 <link rel="stylesheet" type="text/css" href="dummyStyle.css" media="screen" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
<title>Map Dummy</title> 
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> 
<script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js"></script> 
<script type="text/javascript"> 

 
var initialLocation;
var browserSupportFlag =  new Boolean();
var map;
var infowindow = new google.maps.InfoWindow();
var NECorner, SWCorner;
var geocoder = new google.maps.Geocoder();
  
function initialize() {
  var myOptions = {
    zoom: 32,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
  // Try W3C Geolocation method (Preferred)
  if(navigator.geolocation) {
    browserSupportFlag = true;
    navigator.geolocation.getCurrentPosition(function(position) {
      initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
      contentString = "Location found using W3C standard";
      map.setCenter(initialLocation);
      infowindow.setContent(contentString);
      infowindow.setPosition(initialLocation);
      infowindow.open(map);
    }, function() {
      handleNoGeolocation(browserSupportFlag);
    });
  } 
}
 
function handleNoGeolocation(errorFlag) {
  if (errorFlag == true) {
    initialLocation = newyork;
    contentString = "Error: The Geolocation service failed.";
  } else {
    initialLocation = siberia;
    contentString = "Error: Your browser doesn't support geolocation. Are you in Siberia?";
  }
  map.setCenter(initialLocation);
  infowindow.setContent(contentString);
  infowindow.setPosition(initialLocation);
  infowindow.open(map);
}

function GetAddress()
{
	var addr=prompt("Please enter the address you would like to use:","12 Boschkop Avenue, Randburg, South Africa");
	if (addr==null || addr=="")
	  {
			return;
	  }

	
	
	var geocoderrequest = 
	{
		address: addr
	};
	
	geocoder.geocode(geocoderrequest, 
			function (GeocodeResults, GeocodeStatus)
			{
				document.write(GeocodeStatus);
				if (GeocodeStatus == "OK")
				{
					var newlocation = GeocodeResults[0].geometry.location;
					map.setCenter(newlocation);
					infowindow.setContent(addr);
					infowindow.setPosition(newlocation);
					infowindow.open(map);
				}
			});
}
</script> 
 </head>
<body onload="initialize()">
<!--  <CENTER><input type="button" onclick="GetAddress()" value="Enter own address" /></CENTER> -->
  <div id="map_canvas"></div> 
</body> 

</body>